<?php

global $project;
$project = 'site';

// Use _ss_environment.php file for configuration
require_once("conf/ConfigureFromEnv.php");

Director::setBaseURL('/');

// Set the site locale
i18n::set_default_locale('zh_CN');
Translatable::set_default_locale('zh_CN');
SiteTree::add_extension('Translatable');
SiteConfig::add_extension('Translatable');
Translatable::set_allowed_locales(array(
    'en_US',
    'zh_CN'
));

// Enable nested URLs for this site (e.g. page/sub-page/)
if (class_exists('SiteTree')) SiteTree::enable_nested_urls();
//if (class_exists('SiteTree')) FulltextSearchable::enable(array('SiteTree'));

if(!Director::isLive()){
    Deprecation::notification_version('2.4');
    Deprecation::notification_version('3.0');
    Deprecation::notification_version('3.1');
    Deprecation::notification_version('3.2');
}

if(Director::isLive()){
	$mailer = new SmtpMailer('smtp.gmail.com:587', 'info@bjcity.com', 'bjcityinfo', true, 'UTF-8');
	Email::set_mailer($mailer);
	
	// error log
	SS_Log::add_writer(new SS_LogEmailWriter('hut_25@yahoo.com'), SS_Log::WARN, '<=');
}

Config::inst()->remove('TransferAdmin', 'managed_models', Config::anything(), 'BonusAccountTransfer');
Config::inst()->remove('TransferAdmin', 'managed_models', Config::anything(), 'CashAccountTransfer');
Config::inst()->remove('TransferAdmin', 'managed_models', Config::anything(), 'PurchaseAccountTransfer');
Config::inst()->remove('WithdrawalAdmin', 'managed_models', Config::anything(), 'CashAccountWithdrawal');
Config::inst()->remove('ConvertAdmin', 'managed_models', Config::anything(), 'BonusConvertPurchase');
Config::inst()->remove('ConvertAdmin', 'managed_models', Config::anything(), 'BonusConvertUpgrade');
Config::inst()->remove('ConvertAdmin', 'managed_models', Config::anything(), 'CashConvertPurchase');
Config::inst()->remove('ConvertAdmin', 'managed_models', Config::anything(), 'CashConvertUpgrade');
Config::inst()->remove('ConvertAdmin', 'managed_models', Config::anything(), 'CashConvertTradeCoin');
